package com.ofek.eventos.db.datatypes.helptypes;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
 * Interface to define field in table list
 * 
 * @author  Ofek Ron
 *
 */
@Retention(RetentionPolicy.RUNTIME)
public @interface TableFieldInfo {
	/**
	 * The field name
	 * @return String
	 */
	public String name() default "Unknown";
	/**
	 * Is field visible in table
	 * @return boolean
	 */
	public boolean isVisibleOnTable() default false;
	/**
	 * Is field visible in table
	 * @return boolean
	 */
	public Class<? extends Converter> converterType() default DefaultConverter.class;
	public interface Converter {
		public String convert(Object o);
	}
	public class DefaultConverter implements  Converter{

		@Override
		public String convert(final Object o) {
			return o.toString();
		}

	}
}
